import Geohash
handle1= open('d:/222.csv','r')
handle2 = open ('d:/2243.txt','a')
for h in handle1:
    list1=h.split(',')
    id = list1[0]
    x=float(list1[2].replace('\n',''))
    y=float(list1[1])
    hash1=Geohash.encode(x,y,7)
    print id ,x,y,hash1
    handle2.write(str(id)+','+str(x)+','+str(y)+','+str(hash1)+'\n')

handle2.close()
